package org.framework.lazy.cloud.network.heartbeat.server.standalone.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyProxyPerDayFlowApplication;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.proxy.per.day.flow.*;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyProxyPerDayFlowDTO;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.proxy.per.day.flow.LazyProxyPerDayFlow;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.spring.EasyController;

import java.util.List;

/**
 * describe 每日统计代理流量
 *
 * @author Jia wei Wu
 * @date 2025/06/06 11:39 晚上
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController
 **/
@Tag(name = "每日统计代理流量提供者")
@EasyController("/lazy/proxy/per/day/flow")
public class LazyProxyPerDayFlowProvider {

    @Resource
    private LazyProxyPerDayFlowApplication lazyProxyPerDayFlowApplication;

    /**
     * describe 新增每日统计代理流量
     *
     * @param lazyProxyPerDayFlowStoryCommand 新增每日统计代理流量
     * @return {@link Result<LazyProxyPerDayFlow>} 每日统计代理流量新增后领域对象
     * @author Jia wei Wu
     * @date 2025/06/06 11:39 晚上
     **/

    @Operation(summary = "新增每日统计代理流量")
    @PostMapping("/story")
    public Result<LazyProxyPerDayFlow> story(@RequestBody LazyProxyPerDayFlowStoryCommand lazyProxyPerDayFlowStoryCommand) {
        return lazyProxyPerDayFlowApplication.story(lazyProxyPerDayFlowStoryCommand);
    }

    /**
     * describe 批量新增每日统计代理流量
     *
     * @param lazyProxyPerDayFlowStoryCommandList 批量新增每日统计代理流量
     * @return {@link Result<List<LazyProxyPerDayFlow>>} 每日统计代理流量新增后领域对象集合
     * @author Jia wei Wu
     * @date 2025/06/06 11:39 晚上
     **/

    @Operation(summary = "批量新增每日统计代理流量")
    @PostMapping("/batchStory")
    public Result<List<LazyProxyPerDayFlow>> batchStory(@RequestBody List<LazyProxyPerDayFlowStoryCommand> lazyProxyPerDayFlowStoryCommandList) {
        return lazyProxyPerDayFlowApplication.batchStory(lazyProxyPerDayFlowStoryCommandList);
    }

    /**
     * describe 更新每日统计代理流量
     *
     * @param lazyProxyPerDayFlowUpdateCommand 更新每日统计代理流量
     * @return {@link Result<LazyProxyPerDayFlow>} 每日统计代理流量领域对象
     * @author Jia wei Wu
     * @date 2025/06/06 11:39 晚上
     **/

    @Operation(summary = "更新每日统计代理流量")
    @PutMapping("/updateOne")
    public Result<LazyProxyPerDayFlow> updateOne(@RequestBody LazyProxyPerDayFlowUpdateCommand lazyProxyPerDayFlowUpdateCommand) {
        return lazyProxyPerDayFlowApplication.updateOne(lazyProxyPerDayFlowUpdateCommand);
    }

    /**
     * describe 查询单个每日统计代理流量
     *
     * @param lazyProxyPerDayFlowQueryOneCommand 查询单个每日统计代理流量
     * @return {@link Result<LazyProxyPerDayFlowDTO>} 每日统计代理流量DTO对象
     * @author Jia wei Wu
     * @date 2025/06/06 11:39 晚上
     **/

    @Operation(summary = "查询单个每日统计代理流量")
    @GetMapping("/findOne")
    public Result<LazyProxyPerDayFlowDTO> findOne(@ModelAttribute LazyProxyPerDayFlowQueryOneCommand lazyProxyPerDayFlowQueryOneCommand) {
        return lazyProxyPerDayFlowApplication.findOne(lazyProxyPerDayFlowQueryOneCommand);
    }

    /**
     * describe 查询多个每日统计代理流量
     *
     * @param lazyProxyPerDayFlowQueryListCommand 查询多个每日统计代理流量
     * @return {@link Result<List<LazyProxyPerDayFlowDTO>>} 每日统计代理流量DTO对象
     * @author Jia wei Wu
     * @date 2025/06/06 11:39 晚上
     **/

    @Operation(summary = "查询多个每日统计代理流量")
    @GetMapping("/findList")
    public Result<List<LazyProxyPerDayFlowDTO>> findList(@ModelAttribute LazyProxyPerDayFlowQueryListCommand lazyProxyPerDayFlowQueryListCommand) {
        return lazyProxyPerDayFlowApplication.findList(lazyProxyPerDayFlowQueryListCommand);
    }

    /**
     * describe 分页查询多个每日统计代理流量
     *
     * @param lazyProxyPerDayFlowQueryListCommand 分页查询多个每日统计代理流量
     * @return {@link Result<LazyPage<LazyProxyPerDayFlowDTO>>} 分页每日统计代理流量DTO对象
     * @author Jia wei Wu
     * @date 2025/06/06 11:39 晚上
     **/

    @Operation(summary = "分页查询多个每日统计代理流量")
    @GetMapping("/findPage")
    public Result<LazyPage<LazyProxyPerDayFlowDTO>> findPage(@Parameter(description = "分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                                                             @Parameter(description = "当前页数") @RequestParam(defaultValue = "1", value = "current") int current, @ModelAttribute LazyProxyPerDayFlowQueryListCommand lazyProxyPerDayFlowQueryListCommand) {
        return lazyProxyPerDayFlowApplication.findPage(size, current, lazyProxyPerDayFlowQueryListCommand);
    }

    /**
     * describe 删除每日统计代理流量
     *
     * @param lazyProxyPerDayFlowRemoveCommand 删除每日统计代理流量
     * @return {@link Result<LazyProxyPerDayFlow>} 每日统计代理流量
     * @author Jia wei Wu
     * @date 2025/06/06 11:39 晚上
     **/

    @Operation(summary = "删除每日统计代理流量")
    @DeleteMapping("/remove")
    public Result<LazyProxyPerDayFlow> remove(@ModelAttribute LazyProxyPerDayFlowRemoveCommand lazyProxyPerDayFlowRemoveCommand) {
        return lazyProxyPerDayFlowApplication.remove(lazyProxyPerDayFlowRemoveCommand);
    }
}